package com.example.helloservice.controller;

import com.example.api.domain.Person;
import com.example.api.remote.seervice.HelloRemoteService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 改造后的控制
 * @date 2019-4-19 10:38:18
 * @author joker
 */
@RestController
public class HelloRemoteController implements HelloRemoteService {

    @Override
    public String hello(@RequestParam("name") String name) {
        return name;
    }

    @Override
    public String hello(@RequestHeader("name") String name, @RequestHeader("age") Integer age) {
        return name+":"+age;
    }

    @Override
    public String hello(@RequestBody Person person) {
        return person.toString();
    }
}
